package project.ui.main
{
	import components.menus.menubar.MenuBar;
	import components.menus.menubar.MenuItem;
	import components.menus.menubar.MenuSubItem;
	import components.util.MessageResource;
	
	import project.util.Constants;
	
	public class Menu
	{
		[Bindable]
		private var messageResource:MessageResource = MessageResource.getInstance();
	
		public function Menu(menuBar:MenuBar)
		{
			createMenuAcesso(menuBar);
		}
		 
		private function createMenuAcesso(menuBar:MenuBar):void
		{
			// Controle de Acesso
			var menuAcesso:MenuItem = new MenuItem();
			menuAcesso.id = Constants.ACCESS_SCA_CONTROLE_ACESSO;
			menuAcesso.text = messageResource.getText("menu.controle.acesso");

			// Controle de Acesso :: Módulos
			var menuModulo:MenuSubItem = new MenuSubItem();
			menuModulo.id = Constants.ACCESS_SCA_CONTROLE_ACESSO_MODULOS;
			menuModulo.text = messageResource.getText("menu.controle.acesso.modulos");
			menuModulo.description = messageResource.getText("menu.controle.acesso.modulos.descricao");
			menuAcesso.addSubItem(menuModulo);
			
			menuBar.addMenuItem(menuAcesso);
		}
		
	}
}